
import FlowWallMaterialShader from "../shader/wall/FlowWallMaterialShader.glsl?raw";
import TrailWallMaterialShader from "../shader/wall/TrailWallMaterialShader.glsl?raw";
import BreathWallMaterialShader from "../shader/wall/BreathWallMaterialShader.glsl?raw";
import TrailBreathWallMaterialShader from "../shader/wall/TrailBreathWallMaterialShader.glsl?raw";
import GradientWallMaterialShader from "../shader/wall/GradientWallMaterialShader.glsl?raw";
import StaticWallMaterialShader from "../shader/wall/StaticWallMaterialShader.glsl?raw";
import FloodWallMaterialShader from "../shader/wall/FloodWallMaterialShader.glsl?raw";
import LightingWallMaterialShader from "../shader/wall/LightingWallMaterialShader.glsl?raw";
import DiffuseWallMaterialShader from "../shader/wall/DiffuseWallMaterialShader.glsl?raw";

/**
 * 流动墙体
 */
import image from '../image/wall/arrow.png'

Cesium.Material.FlowWallMaterialType = 'FlowWall'
Cesium.Material._materialCache.addMaterial(Cesium.Material.FlowWallMaterialType, {
  fabric: {
    type: Cesium.Material.FlowWallMaterialType,
    uniforms: {
      speed: 1.0,
      color: Cesium.Color.YELLOW,
      image,
      repeat: 1.0
    },
    source: FlowWallMaterialShader
  },
  translucent: function (material) {
    return true
  }
})


/**
 * 上下流动墙体
 */
import fence from '../image/wall/fence.png'

Cesium.Material.TrailWallMaterialType = 'TrailWall'
Cesium.Material._materialCache.addMaterial(Cesium.Material.TrailWallMaterialType, {
  fabric: {
    type: Cesium.Material.TrailWallMaterialType,
    uniforms: {
      speed: 1.0,
      color: Cesium.Color.YELLOW,
      image: fence,
      repeat: 1.0
    },
    source: TrailWallMaterialShader
  },
  translucent: function (material) {
    return true
  }
})

/**
 * 呼吸灯墙效果
 */

Cesium.Material.BreathWallMaterialType = 'BreathWall'
Cesium.Material._materialCache.addMaterial(Cesium.Material.BreathWallMaterialType, {
  fabric: {
    type: Cesium.Material.BreathWallMaterialType,
    uniforms: {
      speed: 1.0,
      color: Cesium.Color.YELLOW
    },
    source: BreathWallMaterialShader
  },
  translucent: function (material) {
    return true
  }
})

/**
 * 呼吸灯墙效果和流动效果
 */

Cesium.Material.TrailBreathWallMaterialType = 'TrailBreathWall'
Cesium.Material._materialCache.addMaterial(Cesium.Material.TrailBreathWallMaterialType, {
  fabric: {
    type: Cesium.Material.TrailBreathWallMaterialType,
    uniforms: {
      speed: 1.0,
      color: Cesium.Color.YELLOW,
      count: 1.
    },
    source: TrailBreathWallMaterialShader
  },
  translucent: function (material) {
    return true
  }
})


/**
 * 径向渐变
 */

Cesium.Material.GradientWallMaterialType = 'GradientWall'
Cesium.Material._materialCache.addMaterial(Cesium.Material.GradientWallMaterialType, {
  fabric: {
    type: Cesium.Material.GradientWallMaterialType,
    uniforms: {
      color: Cesium.Color.fromBytes(75., 207., 250.)
    },
    source: GradientWallMaterialShader
  },
  translucent: function (material) {
    return true
  }
})

/**
 * 静态渐变色 
 */

Cesium.Material.StaticWallMaterialType = 'StaticWall'
Cesium.Material._materialCache.addMaterial(Cesium.Material.StaticWallMaterialType, {
  fabric: {
    type: Cesium.Material.StaticWallMaterialType,
    uniforms: {
      speed: 1.0,
      color: Cesium.Color.YELLOW,
      count: 1.
    },
    source: StaticWallMaterialShader
  },
  translucent: function (material) {
    return true
  }
})

/**
 * 省份渐变色e 
 */

Cesium.Material.FloodWallMaterialType = 'FloodWall'
Cesium.Material._materialCache.addMaterial(Cesium.Material.FloodWallMaterialType, {
  fabric: {
    type: Cesium.Material.FloodWallMaterialType,
    uniforms: {
      color: Cesium.Color.YELLOW,
      diffusePower: 1.,
      alphaPower: 1.
    },
    source: FloodWallMaterialShader
  },
  translucent: function (material) {
    return true
  }
})


/**
 * 扫光面 
 */

Cesium.Material.LightingWallMaterialType = 'LightingWall'
Cesium.Material._materialCache.addMaterial(Cesium.Material.LightingWallMaterialType, {
  fabric: {
    type: Cesium.Material.LightingWallMaterialType,
    uniforms: {
      color: Cesium.Color.PURPLE,
      speed: 1.0
    },
    source: LightingWallMaterialShader
  },
  translucent: function (material) {
    return true
  }
})

/**
* 扩散走马灯 
*/

Cesium.Material.DiffuseWallMaterialType = 'DiffuseWall'
Cesium.Material._materialCache.addMaterial(Cesium.Material.DiffuseWallMaterialType, {
  fabric: {
    type: Cesium.Material.DiffuseWallMaterialType,
    uniforms: {
      color: Cesium.Color.PURPLE
    },
    source: DiffuseWallMaterialShader
  },
  translucent: function (material) {
    return true
  }
})

